from PyQt5.QtWidgets import QDialog
from ui_modify_personal_info import Ui_ModifyPersonalInfo
import requests
from network import Network


class ModifyPersonalInfoWindow(QDialog, Ui_ModifyPersonalInfo):
    def __init__(self, username, parent=None):
        super(ModifyPersonalInfoWindow, self).__init__(parent=parent)
        self.setupUi(self)
        self.username = username
        # self.regButton.clicked.connect(self.reg)
        self.keepButton.clicked.connect(self.keepInfo)

    def keepInfo(self):
        print("keepInfo")
        Network.modify_user_info(self.username, self.passwordLine.text(), self.phoneLine.text(), self.addrLine.text())
        print("已发送")
